/*
************************************************************************************************
*  File     : flash_dev.c
*
*  Description for NXP LPC17xx Flash.
*
*  Author   : zhangchao
*  Version  : 1.0
*
*
************************************************************************************************
*/
#include "LPC177x_8x.h"
#include "flash.h"


#ifdef __FLASH_512
struct FlashDevice const FlashDevice  =  {
	FLASH_DRV_VERS,             // Driver Version, do not modify!
	"LPC17xx IAP 512kB Flash",  // Device Name 
	ONCHIP,                     // Device Type
	0x00000000,                 // Device Start Address
	0x00080000,                 // Device Size (512kB)
	1024,                       // Programming Page Size
	0,                          // Reserved, must be 0
	0xFF,                       // Initial Content of Erased Memory
	100,                        // Program Page Timeout 100 mSec
	3000,                       // Erase Sector Timeout 3000 mSec
	
	// Specify Size and Address of Sectors
	0x001000, 0x000000,         // Sector Size  4kB (16 Sectors)
	0x008000, 0x010000,         // Sector Size 32kB (14 Sectors) 
	SECTOR_END
};
#endif

#ifdef __FLASH_256
struct FlashDevice const FlashDevice  =  {
	FLASH_DRV_VERS,             // Driver Version, do not modify!
	"LPC17xx IAP 256kB Flash",  // Device Name 
	ONCHIP,                     // Device Type
	0x00000000,                 // Device Start Address
	0x00040000,                 // Device Size (256kB)
	1024,                       // Programming Page Size
	0,                          // Reserved, must be 0
	0xFF,                       // Initial Content of Erased Memory
	100,                        // Program Page Timeout 100 mSec
	3000,                       // Erase Sector Timeout 3000 mSec
	
	// Specify Size and Address of Sectors
	0x001000, 0x000000,         // Sector Size  4kB (16 Sectors)
	0x008000, 0x010000,         // Sector Size 32kB ( 6 Sectors) 
	SECTOR_END
};
#endif

#ifdef __FLASH_128
struct FlashDevice const FlashDevice  =  {
	FLASH_DRV_VERS,             // Driver Version, do not modify!
	"LPC17xx IAP 128kB Flash",  // Device Name 
	ONCHIP,                     // Device Type
	0x00000000,                 // Device Start Address
	0x00020000,                 // Device Size (128kB)
	1024,                       // Programming Page Size
	0,                          // Reserved, must be 0
	0xFF,                       // Initial Content of Erased Memory
	100,                        // Program Page Timeout 100 mSec
	3000,                       // Erase Sector Timeout 3000 mSec
	
	// Specify Size and Address of Sectors
	0x001000, 0x000000,         // Sector Size  4kB (16 Sectors)
	0x008000, 0x010000,         // Sector Size 32kB ( 2 Sectors) 
	SECTOR_END
};
#endif

#ifdef __FLASH_64
struct FlashDevice const FlashDevice  =  {
	FLASH_DRV_VERS,             // Driver Version, do not modify!
	"LPC17xx IAP 64kB Flash",   // Device Name 
	ONCHIP,                     // Device Type
	0x00000000,                 // Device Start Address
	0x00010000,                 // Device Size (64kB)
	1024,                       // Programming Page Size
	0,                          // Reserved, must be 0
	0xFF,                       // Initial Content of Erased Memory
	100,                        // Program Page Timeout 100 mSec
	3000,                       // Erase Sector Timeout 3000 mSec
	
	// Specify Size and Address of Sectors
	0x001000, 0x000000,         // Sector Size  4kB (16 Sectors)
	SECTOR_END
};
#endif

#ifdef __FLASH_32
struct FlashDevice const FlashDevice  =  {
	FLASH_DRV_VERS,             // Driver Version, do not modify!
	"LPC17xx IAP 32kB Flash",   // Device Name 
	ONCHIP,                     // Device Type
	0x00000000,                 // Device Start Address
	0x00008000,                 // Device Size (32kB)
	1024,                       // Programming Page Size
	0,                          // Reserved, must be 0
	0xFF,                       // Initial Content of Erased Memory
	100,                        // Program Page Timeout 100 mSec
	3000,                       // Erase Sector Timeout 3000 mSec
	
	// Specify Size and Address of Sectors
	0x001000, 0x000000,         // Sector Size  4kB (8 Sectors)
	SECTOR_END
};
#endif

